home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.1 (Developer) [x86] / NeXT Step 3.1 Intel dev.cdr.dmg / NextDeveloper / Headers / btree / IXStoreDirectory.h < prev    next >
Encoding:
Text File  |  1993-03-31  |  2.3 KB  |  67 lines

  1. /*
  2. IXStoreDirectory.h
  3. Copyright 1991, NeXT Computer, Inc.
  4. */
  5.  
  6. #import    <objc/Object.h>
  7. #import    <store/IXStoreFile.h>
  8.  
  9. @class IXBTreeCursor;
  10.  
  11. // This class implements a simple directory for managing store clients.  The 
  12. // store clients must conform to the IXBlockAndStoreAccess protocol.  Any 
  13. // object may be stored in an IXStoreDirectory, however, as long as it responds 
  14. // to init and the archiving methods read: and write:.
  15.  
  16. @interface IXStoreDirectory: Object <IXNameAndFileAccess>
  17. {
  18.     BOOL        _freeStore;
  19.     char        *_handleName;
  20.     unsigned        _handle;
  21.     IXStore        *_store;
  22.     IXBTreeCursor       *_btreeCursor;
  23. }
  24.  
  25. // Returns the receiver's store, primarily as a convenience for transaction 
  26. // management - e.g., [[client store] startTransaction].
  27.  
  28. - (IXStore *)store;
  29.  
  30. // These methods add new named entries to the directory.  Any class may be 
  31. // supplied, as long as the instances can be meaningfully initialized with the 
  32. // init method and archived with NXWriteRootObject.  If the class is a store 
  33. // client, the instance will be initialized in the directory's store using the 
  34. // initFromBlock:inStore: method.
  35.  
  36. - addEntryNamed:(const char *)aName ofClass:aClass;
  37. - addEntryNamed:(const char *)aName ofClass:aClass atBlock:(unsigned)aHandle;
  38. - addEntryNamed:(const char *)aName forObject:anObject;
  39.  
  40. // This method is obselete.  Use entryNames instead.
  41. - (const char **)entries; // caller must free the array of entry names
  42.  
  43. // Returns newline delimited string containing entry names; caller must free.
  44. - (const char *)entryNames;
  45.  
  46. // These methods remove entries from the directory, but don't remove the 
  47. // associated objects from the store.  Use empty and freeEntryNamed: to free 
  48. // the objects, as well as the entries.
  49.  
  50. - reset; // removes all entries
  51. - removeName:(const char *)aName; // removes, but doesn't free entry object
  52.  
  53. - empty; // frees all entries
  54. - freeEntryNamed:(const char *)aName; // removes and frees associated object
  55.  
  56. // The first of these two methods is redundant.  openEntryNamed simply returns 
  57. // nil if passed an invalid name;  otherwise, it returns the associated object.
  58.  
  59. - (BOOL)hasEntryNamed:(const char *)aName;
  60. - openEntryNamed:(const char *)aName;
  61.  
  62. - getBlock:(unsigned *)aBlock ofEntryNamed:(const char *)aName;
  63. - getClass:(Class *)aClass ofEntryNamed:(const char *)aName;
  64.  
  65. @end
  66.  
  67.